import UsdtAbi from '../abi/Usdt.json'
import UserAbi from '../abi/User.json'
import OrderAbi from '../abi/Order.json'
import PandaxAbi from '../abi/Pandax.json'
import UsdtExchangeAbi from '../abi/Usdt.json'
import CoinExchangeAbi from '../abi/CoinExchange.json'

// 合约地址
window.usdtAddress = import.meta.env.VITE_USDT_ADDRESS // Usdt合约地址
window.userAddress = import.meta.env.VITE_USER_ADDRESS // User合约地址
window.orderAddress = import.meta.env.VITE_ORDER_ADDRESS // Order合约地址
window.pandaxAddress = import.meta.env.VITE_PANDAX_ADDRESS // Pandax合约地址
window.usdtExchangeAddress = import.meta.env.VITE_USDT_EXCHANGE_ADDRESS // 兑换Usdt合约地址
window.coinExchangeAddress = import.meta.env.VITE_COIN_EXCHANGE_ADDRESS // 兑换Coin合约地址
window.defaultParentAddress = import.meta.env.VITE_DEFAULT_PARENT_ADDRESS // 默认顶层地址（注册绑定上下级）

console.log('----------------------------------------')
console.log(`Usdt合约地址：${usdtAddress}`)
console.log(`User合约地址：${userAddress}`)
console.log(`Order合约地址：${orderAddress}`)
console.log(`Pandax合约地址：${pandaxAddress}`)
console.log(`Usdt合约地址：${usdtExchangeAddress}`)
console.log(`兑换Coin合约地址：${coinExchangeAddress}`)
console.log(`默认顶层地址：${defaultParentAddress}`)
console.log('----------------------------------------')

window.ContractConfig = {
  usdt: {
    abi: UsdtAbi,
    address: usdtAddress,
  },
  user: {
    abi: UserAbi,
    address: userAddress,
  },
  order: {
    abi: OrderAbi,
    address: orderAddress,
  },
  pandax: {
    abi: PandaxAbi,
    address: pandaxAddress,
  },
  usdtExchange: {
    abi: UsdtExchangeAbi,
    address: usdtExchangeAddress,
  },
  coinExchange: {
    abi: CoinExchangeAbi,
    address: coinExchangeAddress,
  },
}
